import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'ReviewScreenRainbowProgressIndicator.dart';

class CircularProgressIndicatorCustom extends StatelessWidget {
  final double value;

  const CircularProgressIndicatorCustom({
    super.key,
    required this.value,
  });

  @override
  Widget build(BuildContext context) {
    print('!!!!!!!!!!!!!$value');
    late Color c;
    // Color c = Colors.white;
    double strokeWidth = 4.w;
    if (value == 0) {
      c = Colors.grey;
    } else if (value <= 0.5) {
      c = const Color(0xffFF0000);
      strokeWidth = 10.w;
    } else if (value <= 0.6) {
      c = const Color(0xffFF5800);
      strokeWidth = 6.w;
    } else if (value <= 0.8) {
      c = const Color(0xffEE7D31);
    } else if (value <= 0.9) {
      c = const Color(0xffFACE0A);
    } else if (value < 1) {
      c = const Color(0xff50C878);
    } else if (value == 1) {
      return const RainbowProgressIndicator();
    }
    return CircularProgressIndicator(
      value: value,
      strokeWidth: strokeWidth,
      color: c,
      backgroundColor: Colors.grey[300],
    );
  }
}
